<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName"></use>
  </svg>
</template>
<script>
import { computed } from '@vue/reactivity'
export default {
  name: 'baseSvgIcon',
  props: {
    name: { type: String },
    className: { type: String },
    color: {type: String, default: '#131415'}
  },
  setup(props) {
    const iconName = computed(() => {
      return props.name ? `#icon-${props.name}` : '#icon'
    })
    const svgClass = computed(() => {
      return props.className ? 'svg-icon ' + props.className : 'svg-icon'
    })
    return { iconName, svgClass }
  }
}
</script>
<style scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
